Page({
  data: {
    message: "hello world",
    chooseImageUrl: "",
    viewColors: ["red", "blue", "green", "orange", "purple", "yellow"],
  },
  getUserInfo(e) {
    console.log(e);
    // 调用api获取用户信息
    wx.getUserProfile({
      desc: "desc",
      /* success: (res) => {
        console.log(res)
      } */
    }).then((res) => console.log(res));
  },
  getphonenumber(e) {
    console.log(e);
  },
  onViewClick() {
    console.log("view 被点击了");
  },
  onChooseImage() {
    wx.chooseMedia({
      mediaType: "image",
    }).then((res) => {
      console.log(res);
      const imagePath = res.tempFiles[0].tempFilePath;
      this.setData({
        chooseImageUrl: imagePath,
      });
    });
  },
  onScrolltoupper() {
    console.log("滚动到最顶部/左边");
  },
  onScrolltolower() {
    console.log("滚动到最低部/右边");
  },
  onScroll(e) {
    console.log("发生滚动", e);
  },
});
